﻿#region Legal notice
/*
 * This file is part of EPPLib.
 * Copyright 2010, 2011 
 * Gianluca Esposito (info@gianlucaesposito.it)
 * ----------------------------------------------------------------------------
 * EPPLib is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 * 
 * EPPLib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with Nome-Programma; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
#endregion

#region Using directives
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.Xml.Serialization;
#endregion

namespace EPPLib.Objects
{
    [Serializable]
    [XmlRoot(ElementName = "status", Namespace = "urn:ietf:params:xml:ns:domain-1.0")]
    public class StatusUpdateObject : BaseObject
    {
        #region Members
        private bool? _clientDeletedProhibited;
        private bool? _clientTransferProhibited;
        private bool? _clientUpdateProhibited;
        #endregion

        #region Properties
        [XmlNamespaceDeclarations]
        public XmlSerializerNamespaces xmlns;

        [XmlAttribute(AttributeName = "s")]
        public string Value
        {
            get { 
                if (_clientDeletedProhibited.HasValue) { 
                    return "clientDeletedProhibited"; 
                }
                else if (_clientTransferProhibited.HasValue)
                {
                    return "clientTransferProhibited";
                }
                else if (_clientUpdateProhibited.HasValue)
                {
                    return "clientUpdateProhibited";
                }
                else
                {
                    return string.Empty;
                }
            }
            set { }
        }

        [XmlIgnore]
        public bool? ClientDeletedProhibited { get { return _clientDeletedProhibited; } set { _clientDeletedProhibited = value; } }

        [XmlIgnoreAttribute()]
        public bool ClientDeletedProhibitedSpecified { get { return _clientDeletedProhibited.HasValue && _clientDeletedProhibited.Value == true; } }

        [XmlIgnore]
        public bool? ClientTransferProhibited { get { return _clientTransferProhibited; } set { _clientTransferProhibited = value; } }

        [XmlIgnoreAttribute()]
        public bool ClientTransferdProhibitedSpecified { get { return _clientTransferProhibited.HasValue && _clientTransferProhibited.Value == true; } }

        [XmlIgnore]
        public bool? ClientUpdateProhibited { get { return _clientUpdateProhibited; } set { _clientUpdateProhibited = value; } }

        [XmlIgnoreAttribute()]
        public bool ClientUpdateProhibitedSpecified { get { return _clientUpdateProhibited.HasValue && _clientUpdateProhibited.Value == true; } }
        #endregion

        #region Constructor(s)
        public StatusUpdateObject()
        {
            xmlns = new XmlSerializerNamespaces();
            xmlns.Add("domain", "urn:ietf:params:xml:ns:domain-1.0");
            _clientDeletedProhibited = null;
            _clientTransferProhibited = null;
            _clientUpdateProhibited = null;
        }
        #endregion
    }
}
